# Attention: This can only run under WINDOWS
import tkinter
def build_button(root,i):
    def on_button_click():
        print('Button {} is clicked'.format(i))
    title=str(i)
    button=tkinter.Button(root,text=title,command=on_button_click)
    button.pack()
root=tkinter.Tk()
for i in range(10):
    build_button(root,i)
root.mainloop()
